import socket

# 要有手机
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# 拨打电话
client.connect(("127.0.0.1", 9999))

# 通话
while True:
    print("请输入要发送的内容：")
    send_data = input()
    client.send(send_data.encode("utf-8"))
    if send_data == "close":
        client.close()
        print("关闭连接")
        break
    data = client.recv(1024).decode("utf-8")
    print("接受到服务端响应：", data)
